<template>
	<main>
		<v-headerx></v-headerx>
		<div class="con">
			<img src="../assets/images/download_banner.png" height="220" width="750" alt="">
		</div>

		<div class="list">
			<img :src="data.img" alt="">
			<div class="desc">
				<h2>{{data.name}}</h2>
				<p>{{data.title}}</p>
			</div>
		</div>
		<div class="price">
			<div class="container"><span><strong>{{data.newprice}}</strong><em>{{data.oldprice}}</em></span><button>立即抢购</button></div>
			<ul>
				<li class="c-green">支持随时退款</li>
				<li class="c-green">支持过期自动退</li>
				<li class="c-black">{{data.sold}}</li>
			</ul>
		</div>
		<div class="list1">
			<h2>商家信息</h2>
			<div class="position">
				<div class="position-left">
					<p class="ps1">{{data.newname}}</p>
					<p class="ps2">{{data.position}}</p>
					<p class="ps3"><i class="iconfont icon-fujin"></i>离我最近</p>
				</div>
				<div class="position-right">电话</div>
			</div>
		</div>
		<div class="list2">
		<h3>套餐</h3>
		<p>套餐可选</p>
		<div class="menu">
			<ul v-for="v in data.menuitem">
				<li class="right">{{v.menueat}}</li>
				<li class="middle">{{v.menunum}}</li>
				<li class="left">{{v.menuprice}}</li>
			</ul>
		</div>
	</div>
	<div class="list3">
		<h3>购买须知</h3>
		<div v-for="v in data.noticeitem" class="notice-item">
			<h4>{{v.noticetitle}}</h4>
			<p>{{v.noticecontent}}</p>
		</div>
	</div>
	</main>
</template>

<script>
	import headerx from "./headerx.vue";
	export default{
		name:"detail",
		data(){
			return{
				data:""
			}
		},
		components:{
			"v-headerx":headerx
		},
		mounted(){
			this.$store.state.title="团购详情";
			this.$http.get("./static/data/detail.json").then(function(res){
				console.log(res.body.data[this.$store.state.num]);
				this.data=res.body.data[this.$store.state.num];
				console.log(this.data)
			})
		}
	}
</script>

<style scoped>
	.con{
		border-bottom: 1px solid #c6c0b3;
	}
	.con img{
	    width: 100%;
	    margin-bottom: -.2rem;
	}

	.list{
		 width: 100%;
	    height: 0px;
	    padding-bottom: 40%;
	    overflow: hidden;
	    position:relative;
	}
	.list img{
		width:100%;
	}
	.list .desc{
	    margin-bottom: .14rem;
	    font-size: .38rem;
	    line-height: 1.1;
	    position: absolute;
	    width: 100%;
	    padding: .1rem;
	    background: rgba(16, 16, 16, 0.28);
	    color: white;
	    bottom: -7px;
	}
	.list .desc h2{
	    font-size: .38rem;
	    margin-bottom: .2rem;
	}
	.list .desc p{
		font-size: .3rem;
	}
	.price{
		background: white;
	    position: relative;
	    color: #999;
	    width: 100%;
	    box-sizing: border-box;
	}
	.price button{
	    height: .8rem;
	    width: 2.6rem;
	    margin: 0;
	    line-height: .8rem;
	    font-size: .4rem;
	    background-color: #f90;
	    color: white;
	    outline: none;
	    border: none;
	    float: right;
	    position: relative;
	    margin-top: .2rem;
	}
	.price strong{
	    font-size: .66rem;
	    color:#06c1ae;
	}
	.price em{
	    display: inline-block;
	    margin-right: .06rem;
	    font-size: .28rem;
	    font-style: normal;
	    position: relative;
	    top: -.1rem;
	    left: .12rem;
	}
	.price .container{
	    border-bottom: 1px solid #ddd8ce;
	}
	.price ul{
		overflow:hidden;
		box-sizing:border-box;
		padding:.2rem;
	}
	.price ul li{
	    width: 50%;
	    font-size: .3rem;
	    float: left;
	    padding: .1rem 0;
	}
	.price .c-green{
		color:#6bbd00;
	}
	.list1{
		margin-top: .2rem;
		background: white;
		font-size:.28rem;
	}
	.list1 h2{
	    font-size: .34rem;
	    line-height: 1.5;
	    padding: .22rem .2rem .14rem;
	    color: #333;
	    border-bottom: 1px solid #ddd8ce;
	}
	.list1 .position{
		display:flex;
	    padding: .28rem .2rem;
	    border-bottom:1px solid #ddd8ce;
	}
	.list1 .position-left{
		flex-grow:1;
		width:70%;
	}
	.list1 .position-left p{
	    overflow: hidden;
	    text-overflow: ellipsis;
	    white-space: nowrap;
	}
	.list1 .position-right{
	    width: 1.4rem;
	    text-align: center;
	    border-left: 1px solid #ddd8ce;
	    font-size: .5rem;
	    height: 1.2rem;
	    line-height: 1.2rem;
	    color: #06c1ae
	}
	.list1 .ps1{
	    margin-top: 0;
	    margin-bottom: .06rem;
	    font-size: .32rem;
	    color: #000;
	}
	.list1 .ps2{
	    padding-right: .2rem;
	    color: #666;
	}
	.list1 .ps3{
	    color: #eb8706;
	    margin-top: .08rem;
	}
	.list1 .ps3 i{
		margin-right: .3rem;
	}
	.list2{
	    background: white;
	    font-size: .34rem;
	    margin-top: .2rem;
	}
	.list2 h3{
	    line-height: .8rem;
	    padding-left: .2rem;
	}
	.list2 p{
	    background-color: #f8f9fa;
	    padding: .1rem;
	    margin: 0;
	    font-size: .3rem;
	    color: #000;
	    text-align: center;
	    border-bottom: 1px solid #ddd8ce;
	}
	.list2 .menu{
	    /* text-align: center;  */
	    padding-left: .2rem;
	}
	.list2 .menu ul{
	    display: flex;
	    
	    border-bottom: 1px solid #ddd8ce;
	}
	.list2 .menu ul li{
	    line-height: 1rem;
	}
	.list2 .menu ul li.middle{
	    width: 1.7rem;
	    border-right: 1px solid #ddd8ce;
	    border-left: 1px solid #ddd8ce;
	    padding-left: .1rem;
	}
	.list2 .menu ul .right{
	    flex-grow: 1;
	} 
	.list2 .menu ul .left{
	   width: 1.2rem;
	   padding-left: .1rem;
	}
	.list3 {
	    background: white;
	    margin-top: .2rem;
	    font-size: .34rem;
     	margin-bottom: 1.2rem;
	}
	.list3 h3{
	    line-height: .8rem;
	    padding-left: .2rem;
	    border-bottom: 1px solid #ddd8ce;
	}
	.list3 .notice-item{
	    padding: .2rem;
	}
	.list3 .notice-item h4{
	    font-size: .3rem;
	    color: #f90;
	    margin-bottom: .2rem;
	}
	.list3 .notice-item p{
	    font-size: .28rem;

	}
</style>